package com.wxs.pojo;

public class Client {

    public static void main(String[] args) {

        Host host = new Host();

        /*静态代理*/
        /*Proxy proxy = new Proxy(host);
        proxy.rent();*/

        /*动态代理*/
        /*代理实例的调用处理程序*/
        ProxyInvocationHandler handler = new ProxyInvocationHandler();
        handler.setTarget(host);/*设置真实的角色*/
        Rent proxy= (Rent) handler.getProxy();//动态生成对应的代理类！
        proxy.rent();

    }
}
